drupal 8 get field entities

147

drupal 8 get field entities -

// Get first field reference entity.
$entity->get('field_entity_reference')->entity;

// Get all field reference entities.
$entities = $entity->get('field_entity_reference')->referencedEntities();

Comments

Submit
0 Comments